//
//  MDMyViewCell.m
//  迷笛
//
//  Created by . on 2018/9/7.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIMyViewCell.h"

@implementation MIDIMyViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.icon];
        [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.mas_equalTo(WidthScale(15));
            make.width.mas_equalTo(WidthScale(20));
            make.height.mas_equalTo(kDevice_Is_iPhoneX?HeighX(20):HeighX(25));
        }];
        [self addSubview:self.tile];
        [self.tile mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(self.icon.mas_right).offset(WidthScale(10));
            [self.tile setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        
    }
    return self;
}
-(UIImageView *)icon
{
    if (!_icon)
    {
        _icon =[[UIImageView alloc]init];
    }
    return _icon;
}
-(UILabel *)tile
{
    if (!_tile)
    {
        _tile = [[UILabel alloc]init];
        _tile.textColor = [UIColor whiteColor];
        _tile.font = [UIFont systemFontOfSize:WidthScale(16)];
    }
    return _tile;
}
@end
